/*
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

/*
 * Inicio.java
 *
 * Created on Dec 6, 2011, 9:53:50 AM
 */
package vista;

import java.awt.event.KeyEvent;
import javax.swing.*;
import java.awt.*;
import javax.swing.ImageIcon;
import javax.swing.JApplet;
import javax.swing.JLabel;

/**
 *
 * @author LuisDeternoz
 */
public class Inicio extends javax.swing.JFrame {


    public Inicio() {
        initComponents();
               
    }

    /** This method is called from within the constructor to
     * initialize the form.
     * WARNING: Do NOT modify this code. The content of this method is
     * always regenerated by the Form Editor.
     */
    @SuppressWarnings("unchecked")
    // <editor-fold defaultstate="collapsed" desc="Generated Code">//GEN-BEGIN:initComponents
    private void initComponents() {

        jPanel1 = new javax.swing.JPanel();
        jLabel1 = new javax.swing.JLabel();
        btnIrInicio = new javax.swing.JButton();
        rbtnBloqueo = new javax.swing.JRadioButton();
        rbtnEnlace = new javax.swing.JRadioButton();
        rbtnAlarma = new javax.swing.JRadioButton();
        labelAlarma = new javax.swing.JLabel();
        jMenuBar1 = new javax.swing.JMenuBar();
        jMenu1 = new javax.swing.JMenu();
        jMenu2 = new javax.swing.JMenu();

        setDefaultCloseOperation(javax.swing.WindowConstants.EXIT_ON_CLOSE);
        setMinimumSize(new java.awt.Dimension(700, 300));

        jPanel1.setBackground(new java.awt.Color(255, 255, 255));
        jPanel1.setName("jPanel1"); // NOI18N
        jPanel1.setPreferredSize(new java.awt.Dimension(700, 300));

        jLabel1.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/digitelta4.3.jpg"))); // NOI18N
        jLabel1.setMaximumSize(new java.awt.Dimension(700, 114));
        jLabel1.setMinimumSize(new java.awt.Dimension(700, 114));
        jLabel1.setName("jLabel1"); // NOI18N
        jLabel1.setPreferredSize(new java.awt.Dimension(700, 114));

        btnIrInicio.setFont(new java.awt.Font("Levenim MT", 1, 14)); // NOI18N
        btnIrInicio.setText("Ir");
        btnIrInicio.setName("btnIrInicio"); // NOI18N
        btnIrInicio.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                btnIrInicioActionPerformed(evt);
            }
        });

        rbtnBloqueo.setBackground(new java.awt.Color(255, 255, 255));
        rbtnBloqueo.setFont(new java.awt.Font("Levenim MT", 1, 14)); // NOI18N
        rbtnBloqueo.setText("Bloqueo/Desbloqueo");
        rbtnBloqueo.setName("rbtnBloqueo"); // NOI18N
        rbtnBloqueo.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnBloqueoActionPerformed(evt);
            }
        });

        rbtnEnlace.setBackground(new java.awt.Color(255, 255, 255));
        rbtnEnlace.setFont(new java.awt.Font("Levenim MT", 1, 14)); // NOI18N
        rbtnEnlace.setText("Disponibilidad de Enlaces");
        rbtnEnlace.setName("rbtnEnlace"); // NOI18N
        rbtnEnlace.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnEnlaceActionPerformed(evt);
            }
        });

        rbtnAlarma.setBackground(new java.awt.Color(255, 255, 255));
        rbtnAlarma.setFont(new java.awt.Font("Levenim MT", 1, 14)); // NOI18N
        rbtnAlarma.setText("Información Alarmas");
        rbtnAlarma.setName("rbtnAlarma"); // NOI18N
        rbtnAlarma.addActionListener(new java.awt.event.ActionListener() {
            public void actionPerformed(java.awt.event.ActionEvent evt) {
                rbtnAlarmaActionPerformed(evt);
            }
        });

        labelAlarma.setIcon(new javax.swing.ImageIcon(getClass().getResource("/imagenes/gsm logo.jpg"))); // NOI18N
        labelAlarma.setText("prueba");
        labelAlarma.setName("labelAlarma"); // NOI18N

        javax.swing.GroupLayout jPanel1Layout = new javax.swing.GroupLayout(jPanel1);
        jPanel1.setLayout(jPanel1Layout);
        jPanel1Layout.setHorizontalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(74, 74, 74)
                .addComponent(rbtnAlarma)
                .addGap(18, 18, 18)
                .addComponent(rbtnEnlace)
                .addGap(18, 18, 18)
                .addComponent(rbtnBloqueo)
                .addContainerGap(61, Short.MAX_VALUE))
            .addComponent(jLabel1, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, Short.MAX_VALUE)
            .addGroup(javax.swing.GroupLayout.Alignment.TRAILING, jPanel1Layout.createSequentialGroup()
                .addContainerGap(165, Short.MAX_VALUE)
                .addComponent(labelAlarma, javax.swing.GroupLayout.PREFERRED_SIZE, 383, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(152, 152, 152))
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addGap(327, 327, 327)
                .addComponent(btnIrInicio)
                .addContainerGap(332, Short.MAX_VALUE))
        );
        jPanel1Layout.setVerticalGroup(
            jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addGroup(jPanel1Layout.createSequentialGroup()
                .addComponent(jLabel1, javax.swing.GroupLayout.PREFERRED_SIZE, 93, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.RELATED, 14, Short.MAX_VALUE)
                .addComponent(labelAlarma, javax.swing.GroupLayout.PREFERRED_SIZE, 92, javax.swing.GroupLayout.PREFERRED_SIZE)
                .addGap(18, 18, 18)
                .addGroup(jPanel1Layout.createParallelGroup(javax.swing.GroupLayout.Alignment.BASELINE)
                    .addComponent(rbtnEnlace)
                    .addComponent(rbtnAlarma)
                    .addComponent(rbtnBloqueo))
                .addPreferredGap(javax.swing.LayoutStyle.ComponentPlacement.UNRELATED)
                .addComponent(btnIrInicio)
                .addGap(18, 18, 18))
        );

        jMenuBar1.setName("jMenuBar1"); // NOI18N

        jMenu1.setText("File");
        jMenu1.setName("jMenu1"); // NOI18N
        jMenuBar1.add(jMenu1);

        jMenu2.setText("Edit");
        jMenu2.setName("jMenu2"); // NOI18N
        jMenuBar1.add(jMenu2);

        setJMenuBar(jMenuBar1);

        javax.swing.GroupLayout layout = new javax.swing.GroupLayout(getContentPane());
        getContentPane().setLayout(layout);
        layout.setHorizontalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );
        layout.setVerticalGroup(
            layout.createParallelGroup(javax.swing.GroupLayout.Alignment.LEADING)
            .addComponent(jPanel1, javax.swing.GroupLayout.PREFERRED_SIZE, javax.swing.GroupLayout.DEFAULT_SIZE, javax.swing.GroupLayout.PREFERRED_SIZE)
        );

        jPanel1.getAccessibleContext().setAccessibleName("");

        pack();
    }// </editor-fold>//GEN-END:initComponents
  
private void rbtnAlarmaActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnAlarmaActionPerformed

    if (rbtnAlarma.isSelected())      //Con este ciclo ayuda a validar que solo se seleccione un solo radiobutton
    {
        rbtnEnlace.setEnabled(false);
        rbtnBloqueo.setEnabled(false);
    }
    else
    {
       rbtnEnlace.setEnabled(true);
       rbtnBloqueo.setEnabled(true);
       
    }
      
    labelAlarma.setIcon(new javax.swing.ImageIcon("C:\\Users\\LuisDeternoz\\Documents\\NetBeansProjects\\TesisDigitel2\\src\\imagenes\\bts.png")); //Aqui se cambia la imagen segun la opcion

   
}//GEN-LAST:event_rbtnAlarmaActionPerformed

private void rbtnBloqueoActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnBloqueoActionPerformed

    if (rbtnBloqueo.isSelected())   //Con este ciclo ayuda a validar que solo se seleccione un solo radiobutton
    {
        rbtnEnlace.setEnabled(false);
        rbtnAlarma.setEnabled(false);
    }
    else
    {
       rbtnEnlace.setEnabled(true);
       rbtnAlarma.setEnabled(true); 
    }
    
    labelAlarma.setIcon(new javax.swing.ImageIcon("C:\\Users\\LuisDeternoz\\Documents\\NetBeansProjects\\TesisDigitel2\\src\\imagenes\\bts4.png")); //Aqui se cambia la imagen segun la opcion
}//GEN-LAST:event_rbtnBloqueoActionPerformed

private void rbtnEnlaceActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_rbtnEnlaceActionPerformed

    
    if (rbtnEnlace.isSelected())  //Con este ciclo ayuda a validar que solo se seleccione un solo radiobutton
    {
        rbtnAlarma.setEnabled(false);
        rbtnBloqueo.setEnabled(false);
    }
    else
    {
       rbtnAlarma.setEnabled(true);
       rbtnBloqueo.setEnabled(true);
    }
    
    labelAlarma.setIcon(new javax.swing.ImageIcon("C:\\Users\\LuisDeternoz\\Documents\\NetBeansProjects\\TesisDigitel2\\src\\imagenes\\bts3.png")); //Aqui se cambia la imagen segun la opcion
}//GEN-LAST:event_rbtnEnlaceActionPerformed

private void btnIrInicioActionPerformed(java.awt.event.ActionEvent evt) {//GEN-FIRST:event_btnIrInicioActionPerformed

    if (rbtnAlarma.isSelected()) 
    {
        InfoAlarma miventana = new InfoAlarma();
        miventana.setVisible(true);
        this.setVisible(false);
    }
    else if (rbtnEnlace.isSelected())
    {
        Disponibilidad ventanas = new Disponibilidad();
        ventanas.setVisible(true);
        this.setVisible(false);
    }
    
    else if (rbtnBloqueo.isSelected())
    {
        Bloqueo ventana = new Bloqueo();
        ventana.setVisible(true);
        this.setVisible(false);
        
    }
    else
        JOptionPane.showMessageDialog(jPanel1, "Seleccione una opcion");
}//GEN-LAST:event_btnIrInicioActionPerformed

    /**
     * @param args the command line arguments
     */
    public static void main(String args[]) {
        /* Set the Nimbus look and feel */
        //<editor-fold defaultstate="collapsed" desc=" Look and feel setting code (optional) ">
        /* If Nimbus (introduced in Java SE 6) is not available, stay with the default look and feel.
         * For details see http://download.oracle.com/javase/tutorial/uiswing/lookandfeel/plaf.html 
         */
        try {
            for (javax.swing.UIManager.LookAndFeelInfo info : javax.swing.UIManager.getInstalledLookAndFeels()) {
                if ("Nimbus".equals(info.getName())) {
                    javax.swing.UIManager.setLookAndFeel(info.getClassName());
                    break;
                }
            }
        } catch (ClassNotFoundException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (InstantiationException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (IllegalAccessException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        } catch (javax.swing.UnsupportedLookAndFeelException ex) {
            java.util.logging.Logger.getLogger(Inicio.class.getName()).log(java.util.logging.Level.SEVERE, null, ex);
        }
        //</editor-fold>

        /* Create and display the form */
        java.awt.EventQueue.invokeLater(new Runnable() {

            public void run() {
                new Inicio().setVisible(true);
            }
        });
    }
    // Variables declaration - do not modify//GEN-BEGIN:variables
    private javax.swing.JButton btnIrInicio;
    private javax.swing.JLabel jLabel1;
    private javax.swing.JMenu jMenu1;
    private javax.swing.JMenu jMenu2;
    private javax.swing.JMenuBar jMenuBar1;
    private javax.swing.JPanel jPanel1;
    private javax.swing.JLabel labelAlarma;
    private javax.swing.JRadioButton rbtnAlarma;
    private javax.swing.JRadioButton rbtnBloqueo;
    private javax.swing.JRadioButton rbtnEnlace;
    // End of variables declaration//GEN-END:variables
}
